using UnityEngine;
using UnityEngine.EventSystems;

public class DragRect : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IEventSystemHandler
{
	private RectTransform Rect;

	private Vector2 offset;

	private void Start()
	{
		Rect = GetComponent<RectTransform>();
	}

	private void Update()
	{
	}

	public void OnBeginDrag(PointerEventData eventData)
	{
		offset = Rect.anchoredPosition - eventData.position;
	}

	public void OnDrag(PointerEventData data)
	{
		Rect.anchoredPosition = data.position + offset;
	}

	private void SetDraggedPosition(PointerEventData data)
	{
	}

	public void OnEndDrag(PointerEventData eventData)
	{
	}
}
